import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store/index.js'
import fastclick from 'fastclick'
import VueLazyload from 'vue-lazyload'
import axios from 'axios'
import VueAMap from 'vue-amap';
import VueAwesomeSwiper from 'vue-awesome-swiper';

import 'swiper/dist/css/swiper.css';
import './assets/common/css/index.stylus';

Vue.use(VueAMap);
Vue.use(VueAwesomeSwiper, /* { default global options } */);

VueAMap.initAMapApiLoader({
 	key: 'abe4faf911c694687ddcd63c04a37b23',
 	plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
  	// 默认高德 sdk 版本为 1.4.4
  	uiVersion: '1.0.11'
});


Vue.config.productionTip = false

fastclick.attach(document.body)

Vue.use(VueLazyload, {
  // loading: require();
})


// router.beforeEach((to, from, next) => {
	
// 	next();
// });

router.afterEach((to, from, next) => { 
    window.scrollTo(0, 0);
});

Vue.prototype.$http = axios; 
/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>',
    mounted(){
        if(screen.width > 760){
            window.location.href = "https://www.zhiplusyun.com/";   //pc端官网
        }        
    }
})
